﻿using Entity.Models.Entities;
using System;
using System.Collections.Generic;
using System.Text;

namespace Entity.Models.dto
{
    /// <summary>
    /// 部门DTO类
    /// </summary>
    public class DepartmentDTO
    {

        /// <summary>
        /// id
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string _description { get; set; }
        /// <summary>
        /// 部门名称
        /// </summary>
        public string _departmentName { get; set; }

        /// <summary>
        /// 主管
        /// </summary>
        public string _leaderName { get; set; }

        /// <summary>
        /// 父部门
        /// </summary>
        public string _parentName { get; set; }


        /// <summary>
        /// 创建时间
        /// </summary>
        public string _createTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? _isDelete { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? _deleteTime { get; set; }


        public DateTime _createTimes { get; set; }

        //构造
        public DepartmentDTO(DepartmentDTO department)
        {
            Id = department.Id;
            _description = department._description;
            _departmentName = department._departmentName;
            _leaderName = department._leaderName;
            _parentName = department._parentName;
            _createTime = department._createTimes.ToString("yyyy-MM-dd HH:mm:ss");
            _isDelete = department._isDelete;
            _deleteTime = department._deleteTime;
        }

        public DepartmentDTO(DepartmentInfo department)
        {
            Id = department.Id;
            _description = department.Description;
            _departmentName = department.DepartmentName;
            _leaderName = department.LeaderId;
            _parentName = department.ParentId;
            _createTime = department.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
            _isDelete = department.IsDelete;
            _deleteTime = department.DeleteTime;
        }

        public DepartmentDTO()
        {
        }
    }
}
